<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="1" onclick="fn(this)">
<input type="button" value="1" onclick="fn(this)">
<input type="button" value="1" onclick="fn(this)">
</body>
<script>
    function fn(obj) {
        let value = parseInt(obj.value);
        obj.value = value+1;
    }
</script>
</html>